//
//  TrailerDetailVC.m
//  Buiom_7.0
//
//  Created by lanou3g on 15/10/30.
//  Copyright © 2015年 triffe. All rights reserved.
//

#import "TrailerDetailVC.h"

@interface TrailerDetailVC ()<UIWebViewDelegate>
@property (nonatomic, strong) UIWebView *webView;


@end

@implementation TrailerDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 创建webView
    self.webView = [[UIWebView alloc] initWithFrame:self.view.frame];
    [self.view addSubview:_webView];
    self.webView.delegate = self;
    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.UrlStr]]];

    
    UIBarButtonItem *left = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"houtuiyibu"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:(UIBarButtonItemStylePlain) target:self action:@selector(actionLeft:)];
    self.navigationItem.leftBarButtonItem = left;
    
    UIBarButtonItem *right = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"share"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] style:(UIBarButtonItemStylePlain) target:self action:@selector(actionTrialRight:)];
    self.navigationItem.rightBarButtonItem = right;

    
}

// 实现方法
- (void)actionLeft:(UIBarButtonItem *)bar
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)actionTrialRight:(UIBarButtonItem *)bar
{
    NSString *shareString = [NSString stringWithFormat:@"%@,播放网址:%@",self.trailStr,self.UrlStr];
    [UMSocialSnsService presentSnsIconSheetView:self appKey:@"56374807e0f55a245800042a" shareText:shareString shareImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:self.imageURL]]] shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,UMShareToTencent,UMShareToTwitter,UMShareToDouban,UMShareToRenren,nil] delegate:nil];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
